// 用在管理员修改用户信息的时候调用,在edit里调用
const cloud = require('wx-server-sdk')

cloud.init()
const db = cloud.database();

// 云函数入口函数
exports.main = async (event, context) => {
        console.log('event:',event)
        return await db.collection('user').doc(event.id).update({
                data: {
                  name: event.name, //姓名
                  bodyheight: event.bodyheight, //身高
                  bodyheight_ind: parseInt(event.bodyheight_ind),
                  bodyweight: event.bodyweight, //体重
                  bodyweight_ind: parseInt(event.bodyweight_ind),
                  sex: event.sex, //性别
                  sex_ind: parseInt(event.sex_ind),
                  age: event.age, //年龄
                  age_ind: parseInt(event.age_ind),
                  education: event.education, //学历
                  education_ind: parseInt(event.education_ind),
                  family: event.family, //家庭成员
                  family_ind: parseInt(event.family_ind),
                  marriage: event.marriage, //婚姻状态
                  marriage_ind: parseInt(event.marriage_ind),
                  houses: event.houses, //购房状态
                  houses_ind: parseInt(event.houses_ind),
                  phones: event.phones, //红娘电话
                  phone: event.phone, //客户电话
                  claim: event.claim, //择偶条件
                  directions: event.directions, //红娘说
                  imageispwd: event.imageispwd, //查看图片是否需要密码?
                  imagepwd: event.imagepwd, //查看图片的密码
                  address: event.address, //用户的地址
                  image: event.image, //图片列表
                  video: event.video, //视频列表
                  pengyouquan:event.pengyouquan//朋友圈
                }
        })
}